package com.gz.springcloud.service;

import com.gz.springcloud.entity.Member;
import com.gz.springcloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//有了FeignClient也可以不写@Component
//如果请求出现问题，返回MemberFeignFallbackService类的方法，快速失败(返回)
@FeignClient(value = "member-service-nacos-provider",fallback = MemberFeignFallbackService.class)
public interface MemberOpenFeignService {

    //向服务器发送请求
    @GetMapping("/member/get/{id}")
    public Result<Member> getMemberById(@PathVariable("id") Long id) ;
}
